
class Student:
    def __init__(self,name):
        self.name = name
    def say_hello(self):
        print(f'{self.name}说：老师好!')


class Teacher:
    def __init__(self,name):
        self.name = name
    def say_hello(self):
        print(f'{self.name}说：同学们好!')

xuesheng = Student('张三同学')
laoshi = Teacher('王老师')

print(type(xuesheng))
print(type(laoshi))

def fun(obj):
    obj.say_hello()

fun(laoshi)